<meta charset="UTF-8">

<h1>f12查看效果</h1>
<script src="./utils.js"></script>


<h1>输入时间距今时间</h1>
<div id="demo1"></div>
<script>
var result = ``
result += `dateFormat('2017-3-3 5:18:19') ~~~~~${dateFormat('2017-3-3 5:18:19')} <br>`
result += `dateFormat('2022-3-3 5:18:19') ~~~~~${dateFormat('2022-3-3 5:18:19')} <br>`
result += `dateFormat('2022-4-3 5:18:19') ~~~~~${dateFormat('2022-4-3 5:18:19')} <br>`
result += `dateFormat('2022-4-14 5:18:19') ~~~~${dateFormat('2022-4-14 5:18:19')} <br>`
document.querySelector('#demo1').innerHTML = result
</script>


<h1>返回当前年月日</h1>
<div id="demo2"></div>
<script>
var result = ''
result += `format('YmdHis')~~~~~~~~~~${format('YmdHis')}<br>`
result += `format('Y-m-d H:i:s')~~~~~${format('Y-m-d H:i:s')}<br>`
result += `format('Y-m-d ')~~~~~~~~~~${format('Y-m-d')}<br>`
document.querySelector('#demo2').innerHTML = result
</script>



<h1>判断浏览器类型</h1>
<div id="demo3"></div>
<script>
var result = ''
result += `browser()~~~~~~~~~~${browser()}<br>`
document.querySelector('#demo3').innerHTML = result
</script>


<h1>判断是PC还是移动端</h1>
<div id="demo4"></div>
<script>
var result = ''
result += `browserPc()~~~~~~~~~~${browserPc()}<br>`
document.querySelector('#demo4').innerHTML = result
</script>


<h1>判断是否是微信内置浏览器</h1>
<div id="demo5"></div>
<script>
var result = ''
result += `browserWx()~~~~~~~~~~${browserWx()}<br>`
document.querySelector('#demo5').innerHTML = result
</script>



<h1>获取非行内样式</h1>
<div id="demo6"></div>
<script>
var result = ''
// let Obj = document.querySelector('#demo8')
result += `getAttr(obj, attr)~~~~~~~~~~${getAttr(obj, attr)}<br>`
// result += `getStyle(Obj,'fontSize')~~~~~~~~~~${getStyle(Obj,'fontSize')}<br>`
// result += `getStyle(Obj,'width')~~~~~~~~~~${getStyle(Obj,'width')}<br>`
document.querySelector('#demo6').innerHTML = result
</script>


<h1>随机颜色</h1>
<div id="demo7"></div>
<script>
var result = ''
result += `randomColor()~~~~~~~~~~${randomColor()}<br>`
result += `randomColor()~~~~~~~~~~${randomColor()}<br>`
result += `randomColor()~~~~~~~~~~${randomColor()}<br>`
document.querySelector('#demo7').innerHTML = result
</script>
